#ifndef FWRITE_HPP
#define FWRITE_HPP 1

#include <iostream>
#include <fstream>
#include <cstdint>
#include <boost/crc.hpp>

namespace fur
{
   class FWrite
   {
   public:
      FWrite(std::ostream &outfile);
      ~FWrite();
      void write(const uint8_t *data, size_t size);
      uint32_t get_crc();
      uint64_t get_writtensize();
   private:
      boost::crc_optimal<32, 0x4c11db7, 0xffffffff, 0, true, true> datacrc;
      uint64_t writtensize;
      std::ostream &os;
   };
   
} // end of namespace fur

#endif /* fwrite.hpp */
